package com.pithypan.convert;

import com.pithypan.entity.FileInfo;
import com.pithypan.vo.FileInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 使用前先在pom.xml文件引入MapStruct依赖
 * FileInfo To FileInfoVo
 */
@org.mapstruct.Mapper
public interface FileInfoConvert {   //对象属性的映射（vo对象和dto对象之间的相同属性才会进行映射）

    FileInfoConvert INSTANCE = Mappers.getMapper(FileInfoConvert.class);

    //vo 转 entity
    FileInfo vo2entity(FileInfoVo fileInfoVo);

    //entity 转 vo
    FileInfoVo entity2vo(FileInfo fileInfo);

    //List<entity>转换成List<vo>
    List<FileInfoVo> listentity2vo(List<FileInfo> list);
}
